package wjx.ssm.query;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import wjx.ssm.bean.Course;
import wjx.ssm.bean.Teacher;

public class StudentQuery extends BaseQuery {
	private Integer id;
	private String name;
	private Date birthday;
	private Date signupDate;

	private Integer teacherId;
	private Teacher teacher;
	private List<Course> courses;
	
	public StudentQuery orderbyId(boolean isAsc) {
		fieldOrders.add(new FieldOrder("id", isAsc ? "ASC" : "DESC"));
		return this;
	}
	

	/*********** order by *************************************/
	public class FieldOrder {
		private String field; // id , name imgUrl
		private String order; // desc asc

		public FieldOrder(String field, String order) {
			this.field = field;
			this.order = order;
		}

		public String getField() {
			return field;
		}

		public void setField(String field) {
			this.field = field;
		}

		public String getOrder() {
			return order;
		}

		public void setOrder(String order) {
			this.order = order;
		}
	}

	// orderby 集合
	private List<FieldOrder> fieldOrders = new ArrayList<FieldOrder>();
	
	public List<FieldOrder> getFieldOrders() {
		return fieldOrders;
	}

	public void setFieldOrders(List<FieldOrder> fieldOrders) {
		this.fieldOrders = fieldOrders;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public Date getSignupDate() {
		return signupDate;
	}

	public void setSignupDate(Date signupDate) {
		this.signupDate = signupDate;
	}

	public Integer getTeacherId() {
		return teacherId;
	}

	public void setTeacherId(Integer teacherId) {
		this.teacherId = teacherId;
	}

	public Teacher getTeacher() {
		return teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	public List<Course> getCourses() {
		return courses;
	}

	public void setCourses(List<Course> courses) {
		this.courses = courses;
	}
}
